package com.cunshe.service;

import com.cunshe.dao.MemorabiliaDao;
import com.cunshe.domain.Memorabilia;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 大事记
 */
@Service
public class MemorabiliaService {

    @Autowired
    private MemorabiliaDao memorabiliaDao;

    @Transactional(rollbackFor = Exception.class)
    public int insert(Memorabilia record) {
        return memorabiliaDao.insert(record);
    }

    @Transactional(rollbackFor = Exception.class)
    public int delete(Long id) {
        return memorabiliaDao.delete(id);
    }

    @Transactional(rollbackFor = Exception.class)
    public int update(Memorabilia record) {
        return memorabiliaDao.update(record);
    }

    public List<Memorabilia> list() {
        return memorabiliaDao.list();
    }

}